<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>
			// 1.定义数组
			var movies = ["海王", "上海堡垒", "唐人街探案", "少年派"];
			
			
			// 2.获取数组的长度属性:length
			console.log(movies.length);
			
			// 3.根据索引值获取数据
			// 强调:如果传入不存在的索引值,返回的数据是undefined
			var m1 = movies[1];
			var m2 = movies[10];
			var m3 = movies[-1];
			console.log(m1,m2,m3);
			
			
		</script>
	</body>
</html>
